package luob.study;

import java.lang.reflect.Method;

public class LogHandler implements InvocationHandler {

	private Object target;

	public LogHandler(Object target) {
		super();
		this.target = target;
	}

	@Override
	public void invoke(Object o, Method m, Object[] params) {
		System.out.println("log starttime:" + System.currentTimeMillis());
		try {
			m.invoke(target, params);
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println("log endtime:" + System.currentTimeMillis());
	}

}
